package org.xbs.demo1.mapper;

import org.apache.ibatis.annotations.*;
import org.xbs.demo1.pojo.Dept;
import org.xbs.demo1.pojo.User;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select * from depts")//查询所有部门数据
    List<Dept> getDepts();
    @Delete("delete from depts where id = #{id}")
    void deleteDeptsById(Integer id);
    @Insert("insert into depts(dept_name,create_time,update_time) values(#{deptName},#{createTime},#{updateTime})")
    void addDepts(Dept dept);
    @Update("update depts set dept_name = #{deptName},update_time = #{updateTime} where id = #{id}")//用于更新部门
    void updateDeptsById(Dept dept);
    @Select("select * from depts where id = #{id}")//根据id查询回显
    Dept getDeptsById(Integer id);

}
